home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12768 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: galaxy.ucr.edu!not-for-mail
  2. From: thp@cs.ucr.edu (Tom Payne)
  3. Newsgroups: comp.lang.c++,comp.lang.java
  4. Subject: Re: Java: What's the Big Deal?
  5. Followup-To: comp.lang.c++,comp.lang.java
  6. Date: 21 Mar 1996 15:52:07 GMT
  7. Organization: University of California, Riverside
  8. Message-ID: <4irtv7$cnl@galaxy.ucr.edu>
  9. References: <milodDoF9JF.K32@netcom.com> <1996Mar20.154600.12011@amc.com> <milodDoL1uy.581@netcom.com>
  10. NNTP-Posting-Host: corvette.ucr.edu
  11. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  12.  
  13. John DiCamillo (milod@netcom.com) wrote:
  14. : curtis@amc.com (Curtis Green) writes:
  15. : >John DiCamillo (milod@netcom.com) wrote:
  16. : >: pete@borland.com (Pete Becker) writes:
  17. : >: >There's no reason you can't write a C++ compiler that generates a Java 
  18. : >: >bytestream.
  19. : >: Are you claiming that arbitrary, correct (ANSI) C++ code can
  20. : >: be compiled to the JVM and continue to work correctly?  Or are
  21. : >: you claiming that a compiler can be written that will translate
  22. : >: some limited subset of C++ into JVM?
  23. : >you would just need a proper backend to do the translation into a 
  24. : >JAVA virtual
  25. : >machine compatible bytestream
  26. : You seem convinced that it is possible to create such a "proper
  27. : backend".  Given the semantic differences between C++ pointers
  28. : and arrays and Java references and arrays, I remain skeptical.
  29.  
  30. As long as JVM supports arrays, it is probably not too difficult to
  31. use one to emulate main memory (and its indices to emulate pointers).
  32. Still, there can be performance-killing devils lurking in the details,
  33. e.g., unions, bit-wise operations, etc.
  34.  
  35. More to the point, one can write a compiler (e.g., yet another
  36. targeting of g++) that will be about as efficient as Java on the
  37. subset of C++ supprted by Java.
  38.  
  39. Tom Payne (thp@cs.ucr.edu)
  40.